﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for BaseWebPart
/// </summary>
public abstract class BaseWebPart : System.Web.UI.UserControl
{
    public delegate void DeleteWebPartEventHandler(System.Web.UI.UserControl sender, EventArgs e);
    public event DeleteWebPartEventHandler DeleteWebPart;

    protected virtual void RemoveWebPart()
    {
        // Make a temporary copy of the event to avoid possibility of
        // a race condition if the last subscriber unsubscribes
        // immediately after the null check and before the event is raised.
        DeleteWebPartEventHandler handler = DeleteWebPart;
        if (handler != null)
        {
            handler(this, new EventArgs());
        }
    }

}